// Package bizerror
// @File: biz_error.go
// @Description: 业务错误定义
// @Author: YaoRuiQi
// @Date: 2025/8/23 03:19

package bizerror

import (
	"GinStandardTemplate/internal/pkg/codes"
	"errors"
)

type BizError struct {
	Code codes.CodeInfo
	Err  error
}

func (e *BizError) Error() string {
	return e.Err.Error()
}

func NewBizError(code codes.CodeInfo, errMsg string) *BizError {
	return &BizError{Code: code, Err: errors.New(errMsg)}
}
